<template>
    <div>
        <header>
            <div class="sub-title">
                <div class="sub-text">合作社涉及农户</div>
                <p class="sub-text-en">Farmers involved in cooperatives</p>
            </div>
        </header>
        <div style="margin-top: 26px" class="distributor-box">
            <div class="problem-header clear-float">
                <span class="problem-item">排名</span>
                <span class="problem-item">合作社</span>
                <span class="problem-item">规模</span>
                <span class="problem-item">供应品种</span>
                <span class="problem-item">农户</span>
            </div>
            <vue-seamless-scroll :class-option="option" :data="infoData" class="seamless-warp">
                <ul>
                    <li class="clear-float" v-for="item in infoData" :key="item.index">
                        <span class="problem-item"><span class="radius">{{item.index}}</span></span>
                        <span class="problem-item"><Tooltip style="" placement="top-start" :content="item.name"><div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item.name}}</div></Tooltip></span>
                        <span class="problem-item"><Tooltip style="" placement="top-start" :content="item.distributor"><div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item.distributor}}</div></Tooltip></span>
                        <span class="problem-item">{{item.cooperative}}</span>
                        <span class="problem-item">{{item.farmer}}</span>
                    </li>
                </ul>
            </vue-seamless-scroll>
        </div>
    </div>
</template>
<script>
    export default {
        name:'cooperative',
        components: {
        },
        props: {
            current:{
                type: String,
                default: ''
            }
        },
        data () {
            return {

                infoData:[
                    {
                        index:'01',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'02',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'03',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'04',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'05',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'06',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'07',
                        name:'正安县',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'08',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'09',
                        name:'正安县',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    },
                    {
                        index:'10',
                        name:'阡县龙井乡金桥畜禽生态养殖专业合作社',
                        distributor:7600,
                        cooperative:'粮油类',
                        farmer:12
                    }
                ]
            }
        },
        computed: {
            option () {
                return {
                    step: 0.3
                }
            },
        },
        watch: {
            current: function (newQuestion, oldQuestion) {
                if(newQuestion===oldQuestion) return false;
                switch (newQuestion){
                    case 'za':
                        console.log('正安县');
                        break;
                    case 'rhs':
                        console.log('仁怀市');
                        break;
                    case 'zunyi':
                        console.log('遵义市');
                        break;
                }
//                this.axios.get(api).then((response) => {
//                    console.log(response.data)
//                })
//                console.log(newQuestion,oldQuestion)
            }
        },
        methods: {
            init(){

                switch (this.current){
                    case 'za':
                        console.log('正安县数据');
                        break;
                    case 'rhs':
                        console.log('仁怀市数据');
                        break;
                    case 'zunyi':
                        console.log('遵义市数据');
                        break;
                }

//                let _this=this;
                this.infoData.map(function (currentValue,index,arr) {
//                    _this.infoData[index]={
//                       index:currentValue.index,
//                       name:currentValue.name,
                    currentValue.distributor=currentValue.distributor+'(斤)',
                        currentValue.cooperative=currentValue.cooperative,
                        currentValue.farmer=currentValue.farmer+'家'
//                   }
                })
            }
        },
        mounted () {
        },
        created(){
            this.init()

        }
    }

</script>
<style type="text/css">
</style>